<div data-role="page" id="loginPage">
    <div data-role="header">
        <h1>登录</h1>
    </div>
    <div data-role="content">
        <div data-role="fieldcontain">
            <label for="userName">用户名:</label>
            <input type="text" id="userName" required="required" name="userName"
                min="2" max="25" placeholder="用户名长度是2-25个字符" />
        </div>

        <div data-role="fieldcontain">
            <label for="password">密码:</label>
            <input type="password" id="password" required="required" name="password"
                min="7" max="25" placeholder="密码长度是7-25个字符"/>
        </div>

        <div data-role="fieldcontain">
            <input id="loginSubmitBtn" type="button" value="登录" class="btn btn-primary"
               data-theme="b"/>
        </div>
    </div>
    <script type="text/javascript">
       //console.log("url: " + document.location.href)
       url = document.location.href;
       urlArray = url.split("/");
       //console.log(urlArray) ;
       if (urlArray[urlArray.length-1] != "login"){
           //console.log("change page to login page.");
           $.mobile.changePage("/m/login");
       }

    </script>
</div>

<div data-role="page" id="loginErrorPage">
    <div data-role="header">
        <h1>登录错误提示</h1>
    </div>
    <div data-role="content">
        <p>用户名长度为2-25个字符,密码长度为7-25个字符</p>
    </div>
</div>
<script>
    $("#loginPage").bind("pagecreate", function(e) {
        init();
    });
</script>